//
//  BusinessCell.m
//  DailyNews
//
//  Created by lanou3g on 15/8/12.
//  Copyright (c) 2015年 吴涛. All rights reserved.
//

#import "BusinessCell.h"
#import "Myhong.h"
#import "UIImageView+WebCache.h"

@interface BusinessCell ()
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *descLabel;
@end

@implementation BusinessCell

- (void)setModel:(BusinessModel *)model
{
    _model = model;
    
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:model.image]];
    
    _titleLabel.text = model.post[@"title"];
    
    
    if (model.type != 2) {
        _descLabel.text = model.post[@"description"];
    }
}


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 120, SCREEN_WIDTH - 30, 20)];
        _titleLabel.textColor = [UIColor whiteColor];
        _titleLabel.font = [UIFont fontWithName:@"GillSans-Bold" size:16];
        
        _descLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, 140, SCREEN_WIDTH - _titleLabel.frame.origin.x, 20 * 2)];
        _descLabel.font = [UIFont fontWithName:@"GillSans-Bold" size:13];
        _descLabel.textColor = [UIColor whiteColor];
        
        [self addSubview:_descLabel];
        [self addSubview: _titleLabel];
        
    }
    return self;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
